import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:top_foundation/utils/theme/button.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class HttpTestDemoPage extends GetView<HttpTestDemoController> {
  const HttpTestDemoPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return ListView(
      children: [
        ElevatedButton(
            onPressed: () {
              controller.onTest();
            },
            child: Text('点击测试')),
        Text(controller.state.outData),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<HttpTestDemoController>(
      builder: (_) {
        return Scaffold(
          appBar: AppBar(title: const Text("http_test_demo")),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
